<!-- 引入导航模块的宏 render_nav_item -->
{% from 'bootstrap/nav.html' import render_nav_item %}
<!-- 下面是正常的 Bootstrap 页面代码，看起来很复杂，不过可以从官网上拷贝 -->
<!DOCTYPE html>
<html lang="cn">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>{% block title %} Flask Bootstrap {% endblock %}</title>
    <!-- 定义标题块 -->
    <link rel="icon" href="{{ url_for('static', filename='images/favicon 32.ico') }}"> {{ bootstrap.load_css() }}
    <!-- 动态加载 Bootstrap 样式 -->
</head>

<body>

    <main class="container">
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
            <a class="navbar-brand" href="http://127.0.0.1:5000/">一座城，一个人</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item active">
                        <a class="nav-link" href="/">仪表盘 <span class="sr-only">(current)</span></a>
                    </li>
                    <li class="nav-item dropdown ">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        记录管理
                    </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                            <a class="dropdown-item" href="{{ url_for('navigation') }}">导航记录</a>
                            <a class="dropdown-item" href="{{ url_for('search') }}">位置记录</a>

                        </div>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        用户管理
                    </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                            <a class="dropdown-item" href="{{ url_for('user') }}">用户列表</a>
                            <a class="dropdown-item" href="{{ url_for('authority_Management') }}">权限管理</a>

                        </div>
                    </li>
                    <li class="nav-item ">
                        <a class="nav-link" href="{{ url_for('static',filename='resource/book.pdf') }}">使用说明 <span class="sr-only">(current)</span></a>
                    </li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        {{ user.username }}
                    </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                            <a class="dropdown-item" href="{{ url_for('login') }}">注销</a>


                        </div>
                    </li>

                </ul>
            </div>
        </nav>
        {% block content %}
        <!-- 定义内容块 -->
        <h1> Hello ! </h1>
        {% endblock %}
        <footer class="text-center">
            {% block footer %}
            <!-- 定义页脚块 -->
            <small> &copy; 2020 <a href="http://xiheye.club" title="yexihe's blog">yexihe's blog</a>
        </small> {% endblock %}
        </footer>
    </main>

    <!-- 动态加载 Bootstrap js 脚本 -->
    {{ bootstrap.load_js() }}
</body>

</html>